package controller.algorithms;

import reference.codes.CodeAlgorithm;
import reference.constants.ConstantProblem;
import controller.algorithms.personnalAlgo1.PersonnalAlgorithm1;

public class AlgorithmManager {

	private static AlgorithmManager m_algorithmManager;
	private Algorithm m_algorithm;
	
	private AlgorithmManager(){
		this.setAlgorithm();
	}
	
	public static AlgorithmManager getInstance(){
		if(m_algorithmManager==null)
			m_algorithmManager = new AlgorithmManager();
		return m_algorithmManager;
	}
	
	public Algorithm getAlgorithm(){
		return m_algorithm;
	}
	
	private void setAlgorithm(){
		switch(ConstantProblem.CHOSEN_ALGORITHM){
			case CodeAlgorithm.PERSONAL_ALGORITHM_1:
				m_algorithm = new PersonnalAlgorithm1();
				break;
			default:
				break;
		}
	}
}
